package com.servicesManagement.model;
// Generated Dec 13, 2014 11:53:18 AM by Hibernate Tools 3.2.1.GA

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * Service generated by hbm2java
 */
    @Entity
@Table(name = "SERVICE", schema = "SANKAR")
public class Service implements java.io.Serializable {

    private Long serviceId;
    private String version;
    @JsonIgnore
    private ServiceLine serviceLine;
    private BigDecimal changedByUserId;
    private Date changedDate;
    private BigDecimal createdByUserId;
    private Date createdDate;
    private BigDecimal crossSellingGroupId;
    private String description;
    private Date effectiveDate;
    private Date expirationDate;
    private String marketingUrl;
    private String pscuClientEntityType;
    private Set<Attribute> attribute = new HashSet<Attribute>(0);
    
    
    private String level;
    private String type;

    public Service() {
    }

    public Service(Long serviceId) {
        this.serviceId = serviceId;
    }

    public Service(Long serviceId, ServiceLine serviceLine, BigDecimal changedByUserId, Date changedDate, BigDecimal createdByUserId, Date createdDate, BigDecimal crossSellingGroupId, String description, Date effectiveDate, Date expirationDate, String marketingUrl, String pscuClientEntityType, Set serviceAttributeConfs, Set serviceGroupConfs, Set serviceGroups, Set serviceParticipations) {
        this.serviceId = serviceId;
        this.serviceLine = serviceLine;
        this.changedByUserId = changedByUserId;
        this.changedDate = changedDate;
        this.createdByUserId = createdByUserId;
        this.createdDate = createdDate;
        this.crossSellingGroupId = crossSellingGroupId;
        this.description = description;
        this.effectiveDate = effectiveDate;
        this.expirationDate = expirationDate;
        this.marketingUrl = marketingUrl;
        this.pscuClientEntityType = pscuClientEntityType;
        this.attribute = serviceAttributeConfs;

    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "SERVICE_ID", unique = true, nullable = false, scale = 0)
    public Long getServiceId() {
        return this.serviceId;
    }

    public void setServiceId(Long serviceId) {
        this.serviceId = serviceId;
    }

    @Column(name = "VERSION")
    public String getVersion() {
        return this.version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SERVICE_LINE_ID")
    public ServiceLine getServiceLine() {
        return this.serviceLine;
    }

    public void setServiceLine(ServiceLine serviceLine) {
        this.serviceLine = serviceLine;
    }

    @Column(name = "CHANGED_BY_USER_ID")
    public BigDecimal getChangedByUserId() {
        return this.changedByUserId;
    }

    public void setChangedByUserId(BigDecimal changedByUserId) {
        this.changedByUserId = changedByUserId;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "CHANGED_DATE", length = 7)
    public Date getChangedDate() {
        return this.changedDate;
    }

    public void setChangedDate(Date changedDate) {
        this.changedDate = changedDate;
    }

    @Column(name = "CREATED_BY_USER_ID")
    public BigDecimal getCreatedByUserId() {
        return this.createdByUserId;
    }

    public void setCreatedByUserId(BigDecimal createdByUserId) {
        this.createdByUserId = createdByUserId;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "CREATED_DATE", length = 7)
    public Date getCreatedDate() {
        return this.createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    @Column(name = "CROSS_SELLING_GROUP_ID")
    public BigDecimal getCrossSellingGroupId() {
        return this.crossSellingGroupId;
    }

    public void setCrossSellingGroupId(BigDecimal crossSellingGroupId) {
        this.crossSellingGroupId = crossSellingGroupId;
    }

    @Column(name = "DESCRIPTION")
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "EFFECTIVE_DATE", length = 7)
    public Date getEffectiveDate() {
        return this.effectiveDate;
    }

    public void setEffectiveDate(Date effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "EXPIRATION_DATE", length = 7)
    public Date getExpirationDate() {
        return this.expirationDate;
    }

    public void setExpirationDate(Date expirationDate) {
        this.expirationDate = expirationDate;
    }

    @Column(name = "MARKETING_URL")
    public String getMarketingUrl() {
        return this.marketingUrl;
    }

    public void setMarketingUrl(String marketingUrl) {
        this.marketingUrl = marketingUrl;
    }

    @Column(name = "PSCU_CLIENT_ENTITY_TYPE")
    public String getPscuClientEntityType() {
        return this.pscuClientEntityType;
    }

    public void setPscuClientEntityType(String pscuClientEntityType) {
        this.pscuClientEntityType = pscuClientEntityType;
    }

    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinTable(name = "SERVICE_ATTRIBUTE_CONF", joinColumns = {
        @JoinColumn(name = "SERVICE_ID", referencedColumnName = "SERVICE_ID")},
    inverseJoinColumns = {
        @JoinColumn(name = "ATTRIBUTE_ID", referencedColumnName = "ATTRIBUTE_ID")})
    public Set<Attribute> getAttribute() {
        return this.attribute;
    }

    public void setAttribute(Set<Attribute> attribute) {
        this.attribute = attribute;
    }

    @Transient
    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    @Transient
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
    
    
    /*
     @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="service")
     public Set getServiceGroupConfs() {
     return this.serviceGroupConfs;
     }
    
     public void setServiceGroupConfs(Set serviceGroupConfs) {
     this.serviceGroupConfs = serviceGroupConfs;
     }
     @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="service")
     public Set getServiceGroups() {
     return this.serviceGroups;
     }
    
     public void setServiceGroups(Set serviceGroups) {
     this.serviceGroups = serviceGroups;
     }
     @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="service")
     public Set getServiceParticipations() {
     return this.serviceParticipations;
     }
    
     public void setServiceParticipations(Set serviceParticipations) {
     this.serviceParticipations = serviceParticipations;
     }

     */

    @Override
    public String toString() {
        return "Service{" + "serviceId=" + serviceId + ", version=" + version + ", serviceLine=" + serviceLine + ", changedByUserId=" + changedByUserId + ", changedDate=" + changedDate + ", createdByUserId=" + createdByUserId + ", createdDate=" + createdDate + ", crossSellingGroupId=" + crossSellingGroupId + ", description=" + description + ", effectiveDate=" + effectiveDate + ", expirationDate=" + expirationDate + ", marketingUrl=" + marketingUrl + ", pscuClientEntityType=" + pscuClientEntityType + ", attribute=" + attribute + '}';
    }
}
